﻿@model  NB.MGJ.Model.AntiFleeing_Allocation
@{
    Layout = null;
}
@*编辑产品调拨信息*@
<script src="~/Scripts/MGJJS/FleeGoods/CommonBox.js"></script>
<style>
    .form-horizontal .form-group {
        margin-bottom: 15px;
    }
</style>
<form class="form-horizontal" id="form" role="form" onkeydown="if(event.keyCode==13){return false;}">
    @Html.HiddenFor(m => m.ID)
    <div class="form-group">
        <label class="col-sm-2 control-label">调拨编码：</label>
        <div class="col-sm-10">
            @*@Html.TextBoxFor(p => p.FormCode, new { @class = "form-control", @placeholder = "调拨编码", maxlength = 64, disabled = "disabled" })*@
            <input type="text" class="form-control" placeholder="调拨编码" name="FormCode" id="FormCode" value="@Model.FormCode" readonly>
            <div style="color:red">调拨编码：调出库房-调入库房-当前时间</div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">产品名称：</label>
        <div class="col-sm-10">
            @Html.TextBoxFor(p => p.ProductName, new { @class = "form-control", @placeholder = "产品名称", maxlength = 64, disabled = "disabled" })
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">调拨数量：</label>
        <div class="col-sm-10">
            @Html.TextBoxFor(p => p.Num, new { @class = "form-control", @placeholder = "调拨数量", maxlength = 64, disabled = "disabled" })
        </div>
    </div>

    <div class="form-group" style="display:flex;align-items:center">
        <label class="col-sm-2 control-label">查看物流码：</label>
        <div class="col-sm-10">
            <a href="#" onclick="$.MGJ.CommonBox.Dialog_CommonBox('@Model.FilePath')">查看物流码</a>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">调出库房：</label>
        <div class="col-sm-10">
            @Html.DropDownList("FromWarehouseId", null, new { @class = "form-control", disabled = "disabled" })
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label"><span class="red-700">*</span>调入库房：</label>
        <div class="col-sm-10">
            @Html.DropDownList("GoWarehouseId", null, new { @class = "form-control", onchange="OnChange()" })

        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">货品仓位：</label>
        <div class="col-sm-10">
            @Html.TextBoxFor(p => p.Location, new { @class = "form-control", @placeholder = "货品仓位", maxlength = 64, })
        </div>
    </div>

    <div class="form-group">

        <label class="col-sm-2 control-label">备注：</label>
        <div class="col-sm-10">
            @Html.TextBoxFor(p => p.Remark, new { @class = "form-control", @placeholder = "备注", maxlength = 64, })
        </div>
    </div>
</form>

<script>
    $('#form').bootstrapValidator({
        fields: {
            //ProductID: {
            //    validators: {
            //        notEmpty: {
            //            message: '产品名称不能为空'
            //        },
            //    }
            //},
            //ProductName: {
            //    validators: {
            //        notEmpty: {
            //            message: '产品名称不能为空'
            //        },
            //    }
            //},
            //FromWarehouseId: {
            //    validators: {
            //        notEmpty: {
            //            message: '调出库房不能为空'
            //        },
            //    }
            //},
            GoWarehouseId: {
                validators: {
                    notEmpty: {
                        message: '调入库房不能为空'
                    },
                }
            },
        }
    });
    OnChange();
    function OnChange() {
        var formCode = '@Model.FormCode';
        if (formCode.replace(/(^s*)|(s*$)/g, "").length ==0) {
            var formId=@Model.FromWarehouseId;
            var goId=$("#GoWarehouseId").val();
            $.MGJ.CommonBox.FromCode(formId+'-'+goId)
        }
    }
</script>


